<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #spl{
         color: crimson;
        }
    </style>
</head>
<body>
用户名：<input id="inl" name="user" onfocus="inputfocus()">&nbsp;&nbsp;&nbsp;<span id="spl">请输入</span>
<script>
    function inputfocus() {
        document.getElementById("spl").innerHTML="正在输入...."
    }

    //匿名函数设置失去焦点事件
    document.getElementById("inl").onblur=function () {
        document.getElementById("spl").innerHTML="请输入";
    }
</script>

</body>
</html>